package com.itany.mybatis.dao;

import com.itany.mybatis.entity.User;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface UserDao {

    @Select("select * from t_user where id=#{id}")
    public User selectById1(Integer id);

    public User selectById2(Integer id);

    public User selectById3(Integer id);

    public User selectById4(Integer id);

    public User selectById5(Integer id);

    public User selectById6(Integer id);

    public User selectById7(Integer id);

    public User selectById8(Integer id);

    public List<User> selectByRegistDate(Date registDate);

    public List<User> selectByHob(String hob);

    public List<User> selectByHobbies1(String[] hobbies);

    public List<User> selectByHobbies2(@Param("hobbies") String[] hobbies);

    public User selectByUsernameAndPassword1(String username,String password);

    public User selectByUsernameAndPassword2(User user);

    public User selectByUsernameAndPassword3(Map<String,Object> map);

    public User selectByUsernameAndPassword4(@Param("username") String username,@Param("password") String password);

    public List<User> selectAll(String orderColumnName);

    public List<User> selectByPhone(String phone);

    public List<User> selectByLikePhone1(String phone);

    public List<User> selectByLikePhone2(String phone);

    public List<Map<String,Object>> selectAllToMap1();

    public List<Map<String,Object>> selectAllToMap2();

    @MapKey("id")
    public Map<Integer,User> selectAllToMap3();

    @MapKey("id")
    public Map<Integer,Map<String,Object>> selectAllToMap4();


    public void insert(User user);

    public void update(User user);

    public void deleteById(Integer id);




    public List<User> selectByCriteria1(User user);

    public List<User> selectByCriteria2(User user);

    public List<User> selectByUsernames(List<String> usernames);



}



























